package study

fun main(args: Array<String>) {
//    strTpl()
    list()
}
fun strTpl(){
    var a = 1
    val s1 = "a is $a"
    println(s1)
    a= 2
    println(s1)
    val s2 = "${s1.replace("is", "was")}, but now is $a"
    println(s2)
}

fun list(){
    val items = listOf("apple", "banana", "kiwi")
    for (index in items.indices) {
        println("item at $index is ${items[index]}")
    }
}

fun range(){
    val x = 10
    val y = 9
    if (x in 1..y) {
        println("fits in range")
    }
}